<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <style>
    div{
      width: 300px;
      background-color: rgba(0,0,0,0.3);
      padding-top: 10px;/*四个方向的内边距，实现缩进效果  元素会扩大*/
      position: relative;
    }
    input{
      width: 260px;
      border: 0;
      padding :10px 10px;
      margin-left: 5px;
    }
    img{
      position:absolute;
      top: 14px;
      right: 25px;
    }
    p{
        color: red;
        font-size: 15px;
        margin-left: 10px;
    }
  </style>
</head>
<body>
<div>
  <input type="text" placeholder="请输入用户名">
  <img src="http://doc.canglaoshi.org/tstore_v1/images/login/yhm.png" alt="">
  <p>用户名不能为空</p>
</div>

</body>
</html>